﻿namespace DomainServices.Tools.Pdb.SymStore
{
    using System;
    using System.Text;

    internal class SymConstant : ISymbolConstant
    {
        private ISymUnmanagedConstant m_target;

        public SymConstant(ISymUnmanagedConstant target)
        {
            if (target == null)
            {
                throw new ArgumentNullException("target");
            }
            this.m_target = target;
        }

        public string GetName()
        {
            int num;
            this.m_target.GetName(0, out num, null);
            StringBuilder name = new StringBuilder(num);
            this.m_target.GetName(num, out num, name);
            return name.ToString();
        }

        public byte[] GetSignature()
        {
            int pcSig = 0;
            this.m_target.GetSignature(0, out pcSig, null);
            byte[] sig = new byte[pcSig];
            this.m_target.GetSignature(pcSig, out pcSig, sig);
            return sig;
        }

        public object GetValue()
        {
            object pValue = null;
            this.m_target.GetValue(out pValue);
            return pValue;
        }
    }
}

